-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More Initializer Testing #1170
More Initializer Testing #1170
Conversation
"in models that involve ExternalFunctions. We suggest you try " | ||
"setting calculate_variable_options=\u007b'diff_mode': " | ||
"pyomo.core.expr.calculus.differentiate.Modes.reverse_numeric\u007d. " | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this, but is this because you are using sympy for derivatives? Could you use pynumero?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a Pyomo tool so that is a question for them, but yes it is because they are using sympy
by default for the derivatives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsiirola I don't want to put in the effort to trace this back and file a pyomo issue. Is it possible to fall back on pynumero (or maybe more of a stretch make sympy understand AMPL functions? Or just have a pynumero derivative option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eslickj, this is orthogonal to pynumero. But yes, it is possible to automatically fall back on numeric differentiation (or just always use numeric differentiation). I just pushed up Pyomo/pyomo#2812 to have calculate_variable_from_constraint()
automatically fall back on numeric differentiation if symbolic fails (and the user didn't care what differentiation engine to use).
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1170 +/- ##
==========================================
- Coverage 76.67% 76.32% -0.36%
==========================================
Files 369 369
Lines 60306 60613 +307
Branches 11087 11187 +100
==========================================
+ Hits 46237 46260 +23
- Misses 11665 11966 +301
+ Partials 2404 2387 -17
... and 3 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Fixes None
Summary/Motivation:
This PR adds more testing and refinement of Initializers for core unit models.
Changes proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: